package com.xueyi.aixihu.entity.vo;

import com.xueyi.aixihu.entity.po.DtAuthGroup;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.util.StringUtils;

import java.util.Arrays;
import java.util.List;

/**
 * 描述 权限Vo
 *
 * @auther 俞烨
 * @date 2022-08-13 14
 */
@Data
@NoArgsConstructor
public class DtAuthGroupVo {

    private DtAuthGroup dtAuthGroup;
    private List<String> rulesId;

    public DtAuthGroupVo(DtAuthGroup dtAuthGroup) {
        this.dtAuthGroup = dtAuthGroup;
        if (dtAuthGroup != null && !StringUtils.isEmpty(dtAuthGroup.getRules())) {
            this.rulesId = Arrays.asList(dtAuthGroup.getRules().split(","));
        }
    }
}
